﻿<UserControl x:Class="SMS.Views.SalesModule.SaleDetailForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             d:DesignHeight="50"
             d:DesignWidth="1000"
             xmlns:my="clr-namespace:SMS.Controls;assembly=SMS.Controls"
             Loaded="UserControl_Loaded">

    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="25" />
        </Grid.ColumnDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding Path=No}"
                       VerticalAlignment="Center" />
            <TextBox Text="{Binding Path=SaleDetail.Product_Stock_ID, Mode=TwoWay}"
                     Grid.Column="1"
                     Margin="5,0" />
        </Grid>
        <TextBlock Text="{Binding Path=SaleDetail.ProductStockWise.Product.Product_Name}"
                   Grid.Column="1" />
        <TextBlock Text="{Binding Path=SaleDetail.ProductStockWise.ProductBrand.Brand_Name}"
                   Margin="5,0"
                   Grid.Column="2" />
        <TextBox Text="{Binding Path=SaleDetail.SellingUnitPrice, Mode=TwoWay, StringFormat=N2}"
                 Grid.Column="3"
                 TextAlignment="Right" />
        <TextBox Text="{Binding Path=SaleDetail.Quantity, Mode=TwoWay, StringFormat=N}"
                 Margin="5,0"
                 Grid.Column="4"
                 TextAlignment="Right" />
        <TextBox Text="{Binding Path=SaleDetail.TotalAmount, Mode=TwoWay, StringFormat=N2}"
                 Margin="5,0"
                 Grid.Column="5"
                 TextAlignment="Right" />
        <TextBlock Text="{Binding Path=SaleDetail.DiscountValue, FallbackValue=Discount, StringFormat=N2}"
                   Grid.Column="6"
                   HorizontalAlignment="Right"
                   TextAlignment="Right" />
        <TextBlock Text="{Binding Path=SaleDetail.BilledAmount, StringFormat=N2}"
                   Grid.Column="7"
                   Margin="5,0"
                   TextAlignment="Right" />

        <Button Content="X"
                Grid.Column="8"
                ToolTipService.ToolTip="Click to remove this item"
                Command="{Binding Path=CloseCommand}" />
    </Grid>
</UserControl>
